import { createSlice } from "@reduxjs/toolkit";

const counter = createSlice({
  name: "counter",
  initialState: {
    // 数据
    count: 10,
  },
  reducers: {
    // 修改数据
    addCount(state) {
      state.count++;
    },
  },
});

export default counter;
export const { addCount } = counter.actions;
